
<%- if articles %>
    <ul class="list-group">
      <%- articles.each do |article| %>
          <li class="list-group-item">
            <div class="row">
              <div class="col-xs-12 text-left mgt6">
                <%= link_to article.title, article_path(article) %>
              </div>
              <div class="col-xs-12 mgt8 mgb10">
                <div class="row">
                  <%- attachments = article.attachments.where(asset_type: 'image', is_used: true).limit(1) %>
                  <%- if attachments.size > 0  %>
                    <div class="col-xs-4 col-sm-4 col-md-3">
                      <%= link_to image_tag(attachments.first.asset, width: '100%'),  article_path(article) %>
                    </div>
                    <div class="pdl8 col-xs-8 col-sm-8 col-md-9">
                      <%= truncate(remove_html_tags(article.content), length: 180) %>
                      <%= link_to '显示全部', article_path(article), class: 'font12'%>
                    </div>
                  <% else %>
                    <div class="pdl8 col-xs-12 col-sm-12 col-md-12">
                      <%= truncate(remove_html_tags(article.content), length: 180) %>
                      <%= link_to '显示全部', article_path(article), class: 'font12'%>
                    </div>
                  <%end%>

                </div>
              </div>
            </div>
          </li>
      <%- end %>
    </ul>
    <%= render partial: 'common/paginate', locals: {obj: articles} %>
<%- else %>
    <div class="text-center">
       未关注任何主题
    </div>
<% end %>